Skip to content

fix: ignore static fields#54

Closed
Jsinco wants to merge 1 commit into
OkaeriPoland:masterfrom
Jsinco:master
Closed

fix: ignore static fields#54
Jsinco wants to merge 1 commit into
OkaeriPoland:masterfrom
Jsinco:master

Conversation

@Jsinco

@Jsinco Jsinco commented Jan 27, 2026

Copy link
Copy Markdown

Ignores static fields for OkaeriConfig objects. Mainly for Kotlin compatability since we can't access companion object fields.

As far as I'm aware, Okaeri doesn't support static fields for configs anyways so this shouldn't have any real affect

@codecov

codecov Bot commented Jan 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.02%. Comparing base (eaa3bbb) to head (9c74e2c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #54      +/-   ##
============================================
- Coverage     83.06%   83.02%   -0.04%     
  Complexity     1346     1346              
============================================
  Files            96       96              
  Lines          4463     4465       +2     
  Branches        819      820       +1     
============================================
  Hits           3707     3707              
- Misses          469      470       +1     
- Partials        287      288       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

sandrwich added a commit that referenced this pull request Apr 27, 2026
Static fields (other than serialVersionUID, which had a name-based
filter) previously leaked into config declarations because no general
isStatic() filter existed. Most visibly this broke Kotlin compatibility:
companion objects emit a synthetic public static final Companion field
on the enclosing class, causing save() to crash with "cannot simplify
type ...$Companion".

Adds the missing Modifier.isStatic() check in FieldDeclaration.of and
removes the now-redundant serialVersionUID name check (since it is
always static).

Adds a Java regression test (StaticFieldFilterTest) covering static
final, static mutable, serialVersionUID, and all-static-fields cases.

Adds a new core-test-kotlin module with broader Kotlin interop coverage:
companion objects (including named, empty, const val, @JvmStatic),
plain Kotlin classes, var/val properties, nullable types, and default
value handling.

Supersedes #54 (which lacked tests).
@sandrwich

Copy link
Copy Markdown
Member

Fixed in 6.1.0-beta.2

@sandrwich sandrwich closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants